package temp;

import java.io.IOException;

public abstract class AbstractSUTRunner {

	public abstract void setUp();

	public abstract void warmUp();

	public abstract void run();

	public void runSUT() throws IOException {

		System.out.println("setting up test data...");
		setUp();
		System.out.println("setting up test data...done");

		System.out.println("warming up....");
		warmUp();
		System.out.println("warming up....done");

		AutoControl autoControl = new AutoControl();
		String threadNr = autoControl.getThreadNr();
		System.out.println("now load instrumentation scripts.");
		autoControl.runBtrace(threadNr);
		autoControl.wait(2);
		String stapThrNr = autoControl.runStap(threadNr);
		autoControl.wait(2);

		run();

		autoControl.wait(2);
		System.out.println("STAP thr nr: " + stapThrNr);
		autoControl.killStap(stapThrNr);
		autoControl.wait(2);
		autoControl.analyzeJson();
		autoControl.wait(2);
		autoControl.runEureqaServer();
		autoControl.wait(2);
		autoControl.runEureqaClinet();
		System.out.println("program is over.");
	}
}
